package com.demo.result;

import com.taobao.pac.sdk.cp.dataobject.response.MDM_WENYAO_CP_INFO_QUERY.PageInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @name: 李佳
 * @data: 2022/7/1 11:30
 * @className: Result
 * @author: LiJia
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "统一返回")
public class Result<T> implements Serializable {

    @ApiModelProperty(value = "状态码")
    Integer code;

    @ApiModelProperty(value = "返回信息")
    String message;

    @ApiModelProperty(value = "结果集")
    T data;
    PageInfo pageInfo;

    public Result(Integer code, String message) {
        this.code = code;
        this.message = message;
        this.data = null;
    }

    public Result(Integer code, String message, PageInfo pageInfo) {
        this.code = code;
        this.message = message;
        this.data = null;
        this.pageInfo = pageInfo;
    }

}
